let storage = window.localStorage;

// 设置用户信息
export const setUserInfo = function({ commit }, userInfo) {
  commit("SET_USER_INFO", userInfo);
  storage.setItem('userInfo', JSON.stringify(userInfo));
}

// 设置当前选中
export const setActiveItem = function({ commit }, activeItem) {
  commit("SET_ACTIVE_ITEM", activeItem);
  storage.setItem('activeItem', JSON.stringify(activeItem));
}

// 设置单位列表
export const setCompanyList = function({ commit }, companyList) {
  commit("SET_COMPANY_LIST", companyList);
}

// 设置筛选过的单位列表
export const setPeerCompanyList = function({ commit }, peerCompanyList) {
  commit("SET_PEER_COMPANY_LIST", peerCompanyList);
}